﻿using System;
using System.Collections.Generic;
using System.Text;

namespace TSVNAddinUtils
{
	public class UnRegisterCommandFactory : IUtilsCommandFactory
	{
		public IUtilsCommand CreateCommand()
		{
			UtilsCommandComposite commands = new UtilsCommandComposite();

			commands.Add(CreateVSCommand("8.0"));
			commands.Add(CreateVSCommand("9.0"));

			return commands;
		}

		private IUtilsCommand CreateVSCommand(string version)
		{
			UtilsCommandComposite commands = new UtilsCommandComposite();

			VisualStudioConfig visualStudioConfig = new VisualStudioConfig(new RegistryAdapter(), version);

			commands.Add(
				new RemoveLookInFolderCommand(visualStudioConfig)
			);

			commands.Add(
				new ResetAddinCommand(
					new ProcessExecutor(),
					visualStudioConfig
				)
			);

			commands.Add(
				new RemoveBarCommand(new DTEInstanceCreator(version))
			);

			return commands;
		}
	}
}
